<template>
  <div class="app-select">
    <van-dropdown-menu>
      <van-dropdown-item v-model="curValue" :options="options" :disabled="disabled ? disabled : false"/>
    </van-dropdown-menu>
  </div>
</template>



<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';



@Component({
    components: {
      
    }
})
export default class AppSelect extends Vue {

        /**
         * 当前选中值
         *
         * @type {string}
         * @memberof AppSelect
         */
        @Prop() public value?: string;

        get curValue(){
          return this.value;
        }

        set curValue(val:any){
          this.$emit('valuechange',val);
        }

        /**
         * 下拉数据数组
         *
         * @type {any[]}
         * @memberof AppSelect
         */
        public options:any[] = [];

        /**
         * 是否禁用
         *
         * @type {string}
         * @memberof AppSelect
         */
        @Prop() public disabled?: string;

        /**
         * srfkey
         *
         * @type {string}
         * @memberof AppSelect
         */
        @Prop() public codetag?: string;

        /**
         * 初始化方法
         *
         * @memberof AppListMenu
         */
        created() {
          if(this.codetag){
            this.options = this.$store.getters.getCodeListItems(this.codetag);
          } 
        }
}
</script>
<style lang="less">

</style>